From 86eb2b78d607bcd80bcc2d5bb3a0183863386021 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Tue, 17 Feb 2004 17:55:54 +0000 Subject: [PATCH] bitkeeper revision 1.730 (403255aarVxNJS1lCbHzxzUP9v-rRA) XenoUtil.py: Forward port from 1.2 to allocate VD space from fastest part of the disc first. --- tools/xc/py/XenoUtil.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/xc/py/XenoUtil.py b/tools/xc/py/XenoUtil.py index e3b49bd99a..06a623e9bb 100644 --- a/tools/xc/py/XenoUtil.py +++ b/tools/xc/py/XenoUtil.py @@ -276,12 +276,14 @@ def vd_format(partition, extent_size_mb): else: new_id = 0 - for i in range(part_info['nr_sectors'] / extent_size): + num_extents = part_info['nr_sectors'] / extent_size + + for i in range(num_extents): sql ="""INSERT INTO vdisk_extents(vdisk_extent_no, vdisk_id, part_id, part_extent_no) VALUES ("""+ str(new_id + i) + ", 0, "\ + str(blkdev_name_to_number(partition))\ - + ", " + str(i) + ")" + + ", " + str(num_extents - (i + 1)) + ")" cu.execute(sql) cx.commit() -- 2.30.2